package com.woniuxy.springboot.mybatis.service.impl;

import com.woniuxy.springboot.mybatis.mapper.DeptMapper;
import com.woniuxy.springboot.mybatis.pojo.Dept;
import com.woniuxy.springboot.mybatis.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public boolean addDept(Dept dept) {
        boolean flag = false;
        int i = deptMapper.addDept(dept);
        if (i > 0) {
            flag = true;
        }
        return flag;
    }

    @Override
    public boolean deleteDeptById(Integer deptid) {
        boolean flag = false;
        int i = deptMapper.deleteDeptById(deptid);
        if (i > 0) {
            flag = true;
        }
        return flag;
    }
}
